<template>
  <div class="page">
    <el-pagination
      v-if="total > 0"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="formInline.page"
      :page-sizes="[5, 10, 15, 20]"
      :page-size="formInline.psize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total"
    >
    </el-pagination>
  </div>
</template>

<script>
export default {
    props: {
    total: {
      type: Number,
      default: 0,
    },
    pageSize: {
      type: Number,
      default: 5,
    },
  },
  data() {
    return {
        formInline:{
            page:1,
            psize:this.pageSize
        }
    };
  },
  methods:{
      handleSizeChange(val){
          this.formInline.psize=val
          this.$emit("changePage",this.formInline)
      },
      handleCurrentChange(val){
          this.formInline.page=val
          this.$emit("changePage",this.formInline)
      }
  }
};
</script>

<style>
</style>